<html><head>
    <meta charset="utf-8">
    <title>后台用户管理</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta name="csrf-token" content="{{ csrf_token() }}">
    <link rel="stylesheet" href="/layuiAdmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="/layuiAdmin/css/admin.css" media="all">
<body layadmin-themealias="default">

<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-card-header">编辑后台用户&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b>{{$res['username']}}</b></div>
        <div class="layui-card-body" style="padding: 15px;">
            <form class="layui-form" action="" >
                <div class="layui-form-item">
                    <label class="layui-form-label">手机</label>
                    <div class="layui-input-block">
                        <input type="text" name="mobile" lay-verify="" autocomplete="off" placeholder="请输入手机号" class="layui-input" value="{{$res['mobile']}}">
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">邮箱</label>
                    <div class="layui-input-block">
                        <input type="text" name="email" lay-verify="" autocomplete="off" placeholder="请输入邮箱" class="layui-input" value="{{$res['email']}}">
                    </div>
                </div>

              

                <div class="layui-form-item layui-layout-admin">
                    <div class="layui-input-block">
                        <button class="layui-btn" lay-submit="" lay-filter="demo1">立即提交</button>
                        <button type="button" class="layui-btn layui-btn-primary" onclick="location.reload()">重置</button>
                        <button type="button" class="layui-btn layui-btn-primary" onclick="location.href='/admin/adminUser'">返回列表</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>

<script src="/layuiAdmin/layui/layui.js"></script>
<script src="/layuiAdmin/tool.js"></script>

<script>
    var id = {{$id}};
    layui.use(['form'], function() {
        var form = layui.form,
            layer = layui.layer,
            $ = layui.jquery;


        form.on('submit(demo1)', function(data) {

            $.ajaxSetup({
                headers: {
                    'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
                }
            });

            $.post('/admin/adminUser/edit/' + id, data.field, function (rJson) {

                if(rJson.status){
                    successAlert(rJson.msg);
                }else{
                    layer.msg(rJson.msg, {time: 5000, icon:5});
                }
            });
            return false;
        });


    });
</script>


</body>
</html>